

	 /* Copyright (c)2012 Holobloc Inc. All rights reserved. */
//	 package fb.rt.template;
	 import fb.datatype.*;
	 import fb.rt.*;
import fb.rt.events.*;
	 /** FUNCTION_BLOCK CILO_2051
	   * @author JHC
	   * @version 20120111/JHC
	   */
	 public class CILO_2051 extends FBInstance
	 {
	 /** Input event qualifier */
	   public BOOL ROS_1 = new BOOL();
	 /** VAR ROS_2 */
	   public BOOL ROS_2 = new BOOL();
	 /** VAR ROS_3 */
	   public BOOL ROS_3 = new BOOL();
	 /** VAR ROS_4 */
	   public BOOL ROS_4 = new BOOL();
	 /** VAR ROS_5 */
	   public BOOL ROS_5 = new BOOL();
	 /** VAR ROS_6 */
	   public BOOL ROS_6 = new BOOL();
	 /** VAR ROS_7 */
	   public BOOL ROS_7 = new BOOL();
	 /** VAR ROS_8 */
	   public BOOL ROS_8 = new BOOL();
	 /** VAR ROS_9 */
	   public BOOL ROS_9 = new BOOL();
	 /** VAR ROS_10 */
	   public BOOL ROS_10 = new BOOL();
	 /** VAR ROS_m */
	   public BOOL ROS_m = new BOOL();
	 /** VAR m */
	   public STRING m = new STRING();
	 /** VAR n */
	   public STRING n = new STRING();
	/** Output event qualifier */
	   public STRING CILO_VAL = new STRING();
	 /** EVENT EI_INIT */
	  public EventServer EI_INIT = new EventInput(this);
	 /** Initialization Request */
	  public EventServer EI_UPDATA = new EventInput(this);
	 /** Normal Execution Request */
	  public EventServer EI_RULE = new EventInput(this);
	 /** Initialization Confirm */
	  public EventOutput EO_INIT = new EventOutput();
	 /** EVENT EO_CILO */
	  public EventOutput EO_CILO = new EventOutput();
	 /** {@inheritDoc}
	 * @param s {@inheritDoc}
	 * @return {@inheritDoc}
	 */
	   public EventServer eiNamed(String s){
	     if("EI_INIT".equals(s)) return EI_INIT;
	     if("EI_UPDATA".equals(s)) return EI_UPDATA;
	     if("EI_RULE".equals(s)) return EI_RULE;
	     return super.eiNamed(s);}
	 /** {@inheritDoc}
	 * @param s {@inheritDoc}
	 * @return {@inheritDoc}
	 */
	   public EventOutput eoNamed(String s){
	     if("EO_INIT".equals(s)) return EO_INIT;
	     if("EO_CILO".equals(s)) return EO_CILO;
	     return super.eoNamed(s);}
	 /** {@inheritDoc}
	 * @param s {@inheritDoc}
	 * @return {@inheritDoc}
	 * @throws FBRManagementException {@inheritDoc}
	 */
	   public ANY ivNamed(String s) throws FBRManagementException{
	     if("ROS_1".equals(s)) return ROS_1;
	     if("ROS_2".equals(s)) return ROS_2;
	     if("ROS_3".equals(s)) return ROS_3;
	     if("ROS_4".equals(s)) return ROS_4;
	     if("ROS_5".equals(s)) return ROS_5;
	     if("ROS_6".equals(s)) return ROS_6;
	     if("ROS_7".equals(s)) return ROS_7;
	     if("ROS_8".equals(s)) return ROS_8;
	     if("ROS_9".equals(s)) return ROS_9;
	     if("ROS_10".equals(s)) return ROS_10;
	     if("ROS_m".equals(s)) return ROS_m;
	     if("m".equals(s)) return m;
	     if("n".equals(s)) return n;
	     return super.ivNamed(s);}
	 /** {@inheritDoc}
	* @param s {@inheritDoc}
	* @return {@inheritDoc}
	* @throws FBRManagementException {@inheritDoc}
	*/
	  public ANY ovNamed(String s) throws FBRManagementException{
	    if("CILO_VAL".equals(s)) return CILO_VAL;
	    return super.ovNamed(s);}
	/** {@inheritDoc}
	* @param ivName {@inheritDoc}
	* @param newIV {@inheritDoc}
	* @throws FBRManagementException {@inheritDoc} */
	  public void connectIV(String ivName, ANY newIV)
	     throws FBRManagementException{
	     if("ROS_1".equals(ivName)) connect_ROS_1((BOOL)newIV);
	     else if("ROS_2".equals(ivName)) connect_ROS_2((BOOL)newIV);
	     else if("ROS_3".equals(ivName)) connect_ROS_3((BOOL)newIV);
	     else if("ROS_4".equals(ivName)) connect_ROS_4((BOOL)newIV);
	     else if("ROS_5".equals(ivName)) connect_ROS_5((BOOL)newIV);
	     else if("ROS_6".equals(ivName)) connect_ROS_6((BOOL)newIV);
	     else if("ROS_7".equals(ivName)) connect_ROS_7((BOOL)newIV);
	     else if("ROS_8".equals(ivName)) connect_ROS_8((BOOL)newIV);
	     else if("ROS_9".equals(ivName)) connect_ROS_9((BOOL)newIV);
	     else if("ROS_10".equals(ivName)) connect_ROS_10((BOOL)newIV);
	     else if("ROS_m".equals(ivName)) connect_ROS_m((BOOL)newIV);
	     else if("m".equals(ivName)) connect_m((STRING)newIV);
	     else if("n".equals(ivName)) connect_n((STRING)newIV);
	     else super.connectIV(ivName, newIV);
	     }
	 /** Connect the given variable to the input variable ROS_1
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_1(BOOL newIV){
	     ROS_1 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_2
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_2(BOOL newIV){
	     ROS_2 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_3
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_3(BOOL newIV){
	     ROS_3 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_4
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_4(BOOL newIV){
	     ROS_4 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_5
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_5(BOOL newIV){
	     ROS_5 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_6
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_6(BOOL newIV){
	     ROS_6 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_7
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_7(BOOL newIV){
	     ROS_7 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_8
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_8(BOOL newIV){
	     ROS_8 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_9
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_9(BOOL newIV){
	     ROS_9 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_10
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_10(BOOL newIV){
	     ROS_10 = newIV;
	     }
	 /** Connect the given variable to the input variable ROS_m
	   * @param newIV The variable to connect
	  */
	   public void connect_ROS_m(BOOL newIV){
	     ROS_m = newIV;
	     }
	 /** Connect the given variable to the input variable m
	   * @param newIV The variable to connect
	  */
	   public void connect_m(STRING newIV){
	     m = newIV;
	     }
	 /** Connect the given variable to the input variable n
	   * @param newIV The variable to connect
	  */
	   public void connect_n(STRING newIV){
	     n = newIV;
	     }
	 private static final int index_START = 0;
	 private void state_START(){
	   eccState = index_START;
	 }
	 private static final int index_INIT = 1;
	 private void state_INIT(){
	   eccState = index_INIT;
	   alg_INIT();
	   EO_INIT.serviceEvent(this);
	 state_START();
	 }
	 private static final int index_REQ = 2;
	 private void state_REQ(){
	   eccState = index_REQ;
	   alg_REQ();
	   EO_CILO.serviceEvent(this);
	 state_START();
	 }
	 private static final int index_qwer = 3;
	 private void state_qwer(){
	   eccState = index_qwer;
	   alg_asd();
	   EO_CILO.serviceEvent(this);
	 state_START();
	 }
	 /** The default constructor. */
	 public CILO_2051(){
	     super();
	   }
	 /** {@inheritDoc}
	 * @param e {@inheritDoc} */
	 public void serviceEvent(EventServer e){
	     if (e == EI_INIT) service_EI_INIT();
	     else if (e == EI_UPDATA) service_EI_UPDATA();
	     else if (e == EI_RULE) service_EI_RULE();
	   }
	 /** Services the EI_INIT event. */
	   public void service_EI_INIT(){
	     if ((eccState == index_START)) state_INIT();
	   }
	 /** Services the EI_UPDATA event. */
	   public void service_EI_UPDATA(){
	     if ((eccState == index_START)) state_qwer();
	   }
	 /** Services the EI_RULE event. */
	   public void service_EI_RULE(){
	     if ((eccState == index_START)) state_REQ();
	   }
	   /** ALGORITHM INIT IN ST*/
	 public void alg_INIT(){
	 }
	   /** ALGORITHM REQ IN ST*/
	 public void alg_REQ(){
	 }
	   /** ALGORITHM asd IN Java*/
	 final String ROS_1_0 = "ROS_1(0)";
	 final String ROS_1_1 = "ROS_1(1)";
	 final String ROS_2_0 = "ROS_2(0)";
	 final String ROS_2_1 = "ROS_2(1)";
	 final String ROS_3_0 = "ROS_3(0)";
	 final String ROS_3_1 = "ROS_3(1)";
	 final String ROS_4_0 = "ROS_4(0)";
	 final String ROS_4_1 = "ROS_4(1)";
	 final String ROS_5_0 = "ROS_5(0)";
	 final String ROS_5_1 = "ROS_5(1)";
	 final String ROS_6_0 = "ROS_6(0)";
	 final String ROS_6_1 = "ROS_6(1)";
	 final String ROS_7_0 = "ROS_7(0)";
	 final String ROS_7_1 = "ROS_7(1)";
	 final String ROS_8_0 = "ROS_8(0)";
	 final String ROS_8_1 = "ROS_8(1)";
	 final String ROS_9_0 = "ROS_9(0)";
	 final String ROS_9_1 = "ROS_9(1)";
	 final String ROS_10_0 = "ROS_10(0)";
	 final String ROS_10_1 = "ROS_10(1)";
	 fb.datatype.BOOL Check =new BOOL();
	 fb.datatype.STRING string =null;
	 String val="";

	 if (ROS_1.equals(Check)) val=val.concat(ROS_1_0);
	 else val=val.concat(ROS_1_1);
	 val=val.concat("&");

	 if (ROS_2.equals(Check)) val=val.concat(ROS_2_0);
	 else val=val.concat(ROS_2_1);
	 val=val.concat("&");
	 		
	 if (ROS_3.equals(Check)) val=val.concat(ROS_3_0);
	 else val=val.concat(ROS_3_1);
	 val=val.concat("&");
	 		
	 if (ROS_4.equals(Check)) val=val.concat(ROS_4_0);
	 else val=val.concat(ROS_4_1);
	 val=val.concat("&");
	 		
	 if (ROS_5.equals(Check)) val=val.concat(ROS_5_0);
	 else val=val.concat(ROS_5_1);
	 val=val.concat("&");

	 if (ROS_6.equals(Check)) val=val.concat(ROS_6_0);
	 else val=val.concat(ROS_6_1);
	 val=val.concat("+");
	 		
	 if (ROS_7.equals(Check)) val=val.concat(ROS_7_0);
	 else val=val.concat(ROS_7_1);
	 val=val.concat("&");

	 if (ROS_8.equals(Check)) val=val.concat(ROS_8_0);
	 else val=val.concat(ROS_8_1);
	 val=val.concat("&");
	 	
	 if (ROS_9.equals(Check)) val=val.concat(ROS_9_0);
	 else val=val.concat(ROS_9_1);
	 val=val.concat("&");
	 		
	 if (ROS_10.equals(Check)) val=val.concat(ROS_10_0);
	 else val=val.concat(ROS_10_1);
	 val=val.concat("&");
	 		
	 if (ROS_1.equals(Check)) val=val.concat(ROS_1_0);
	 else val=val.concat(ROS_1_1);
	 val=val.concat("&");
	 		
	 if (ROS_2.equals(Check)) val=val.concat(ROS_2_0);
	 else val=val.concat(ROS_2_1);

	 CILO_VAL=new STRING(val);
	 }
	}

